const UserSchema = require('../model/user')
class UserService {
  // 创建用户
  async create(user) {
    const { account, password } = user;
    // 创建数据
    let doc = await UserSchema.create({ account, password })

    return doc
  }

  async login(user) {
    const { account, password } = user;
    // 创建数据
    let doc = await UserSchema.find({}, { account, password })

    return doc
  }
}


module.exports = new UserService()